.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "GDAL_POLYGONIZE" "1" "Feb 08, 2024" "" "GDAL"
.SH NAME
gdal_polygonize \- Produces a polygon feature layer from a raster.
.SH SYNOPSIS
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
gdal_polygonize.py [\-\-help] [\-\-help\-general]
                   [\-8] [\-o <name>=<value>]... [\-nomask] [\-mask <filename>] <raster_file> [\-b <band>]
                   [\-q] [\-f <ogr_format>] [\-lco <name>=<value>]... [\-overwrite]
                   <out_file> [<layer>] [<fieldname>]
.ft P
.fi
.UNINDENT
.UNINDENT
.SH DESCRIPTION
.sp
This utility creates vector polygons for all connected regions of pixels in
the raster sharing a common pixel value.  Each polygon is created with an
attribute indicating the pixel value of that polygon.  A raster mask
may also be provided to determine which pixels are eligible for processing.
.sp
The utility will create the output vector datasource if it does not already exist,
otherwise it will try to append to an existing one.
.sp
The utility is based on the :\fI\%GDALPolygonize()\fP function which has additional
details on the algorithm.
.INDENT 0.0
.TP
.B \-\-help
Show this help message and exit
.UNINDENT
.INDENT 0.0
.TP
.B \-\-help\-general
Gives a brief usage message for the generic GDAL commandline options and exit.
.UNINDENT
.INDENT 0.0
.TP
.B \-8
Use 8 connectedness. Default is 4 connectedness.
.UNINDENT
.INDENT 0.0
.TP
.B \-nomask
Do not use the default validity mask for the input band (such as nodata, or
alpha masks).
.UNINDENT
.INDENT 0.0
.TP
.B \-mask <filename>
Use the first band of the specified file as a validity mask (zero is invalid,
non\-zero is valid). If not specified, the default validity mask for the input
band (such as nodata, or alpha masks) will be used (unless \-nomask is specified)
.UNINDENT
.INDENT 0.0
.TP
.B <raster_file>
The source raster file from which polygons are derived.
.UNINDENT
.INDENT 0.0
.TP
.B \-b <band>
The band on <raster_file> to build
the polygons from. Starting with GDAL 2.2, the value can also be set to \(dqmask\(dq,
to indicate that the mask band of the first band must be used (or
\(dqmask,band_number\(dq for the mask of a specified band)
.UNINDENT
.INDENT 0.0
.TP
.B \-f <ogr_format>
Select the output format. Starting with
GDAL 2.3, if not specified, the format is guessed from the extension (previously
was GML). Use the short format name
.UNINDENT
.INDENT 0.0
.TP
.B \-o <NAME>=<VALUE>
New in version 3.7.

.sp
Polygonize option. See :\fI\%GDALPolygonize()\fP documentation.
.UNINDENT
.INDENT 0.0
.TP
.B \-lco <NAME>=<VALUE>
New in version 3.7.

.sp
Layer creation option (format specific)
.UNINDENT
.INDENT 0.0
.TP
.B \-overwrite
New in version 3.8.

.sp
Overwrite the output layer if it already exists.
.UNINDENT
.INDENT 0.0
.TP
.B <out_file>
The destination vector file to which the polygons will be written.
.UNINDENT
.INDENT 0.0
.TP
.B <layer>
The name of the layer created to hold the polygon features.
.UNINDENT
.INDENT 0.0
.TP
.B <fieldname>
The name of the field to create (defaults to \(dqDN\(dq).
.UNINDENT
.INDENT 0.0
.TP
.B \-q
The script runs in quiet mode.  The progress monitor is suppressed and routine
messages are not displayed.
.UNINDENT
.SH AUTHOR
Frank Warmerdam <warmerdam@pobox.com>
.SH COPYRIGHT
1998-2024
.\" Generated by docutils manpage writer.
.
